/*
origin glsl source: 
#define CC_DEVICE_SUPPORT_FLOAT_TEXTURE 0
#define CC_ENABLE_CLUSTERED_LIGHT_CULLING 0
#define CC_DEVICE_MAX_VERTEX_UNIFORM_VECTORS 4096
#define CC_DEVICE_MAX_FRAGMENT_UNIFORM_VECTORS 1024
#define CC_DEVICE_CAN_BENEFIT_FROM_INPUT_ATTACHMENT 0
#define CC_PLATFORM_ANDROID_AND_WEBGL 0
#define CC_ENABLE_WEBGL_HIGHP_STRUCT_VALUES 0
#define CC_JOINT_UNIFORM_CAPACITY 256
#define CC_EFFECT_USED_VERTEX_UNIFORM_VECTORS 65
#define CC_EFFECT_USED_FRAGMENT_UNIFORM_VECTORS 42

precision mediump float;
vec4 CCFragOutput (vec4 color) {
  return color;
}
varying vec2 v_uv;
uniform sampler2D mainTexture;
vec4 frag () {
  return CCFragOutput(texture2D(mainTexture, v_uv));
}
void main() { gl_FragColor = frag(); }
*/
export let glsl_a3b33aa4c211c3d116dbd1feaca12ad6 = `#define CC_EFFECT_USED_FRAGMENT_UNIFORM_VECTORS 42
#define CC_EFFECT_USED_VERTEX_UNIFORM_VECTORS 65
#define CC_JOINT_UNIFORM_CAPACITY 256
#define CC_ENABLE_WEBGL_HIGHP_STRUCT_VALUES 0
#define CC_PLATFORM_ANDROID_AND_WEBGL 0
#define CC_DEVICE_CAN_BENEFIT_FROM_INPUT_ATTACHMENT 0
#define CC_DEVICE_MAX_FRAGMENT_UNIFORM_VECTORS 1024
#define CC_DEVICE_MAX_VERTEX_UNIFORM_VECTORS 4096
#define CC_ENABLE_CLUSTERED_LIGHT_CULLING 0
#define CC_DEVICE_SUPPORT_FLOAT_TEXTURE 0

precision mediump float;
vec4 CCFragOutput (vec4 color) {
  return color;
}
varying vec2 v_uv;
uniform sampler2D mainTexture;
vec4 frag () {
  return CCFragOutput(texture2D(mainTexture, v_uv));
}
void main() { gl_FragColor = frag(); }
`
import {
    texture2D_N_V2,
    sampler2D,
    samplerCube,
    float,
    float_N,
    bool,
    bool_N,
    int_N,
    int,
    vec4,
    vec3,
    vec2,
    mat2,
    mat3,
    mat4,
} from "../builtin/BuiltinFunc"
import { glSet_V2_V2, glSet_V4_V4, getValueKeyByIndex, getOutValueKeyByIndex } from "../builtin/BuiltinOperator"
import {
    gl_FragData,
    gl_FragColor,
    gl_Position,
    gl_PointSize,
    gl_FragCoord,
    gl_FragDepth,
    gl_FrontFacing,
    custom_isDiscard,
} from "../builtin/BuiltinVar"
import { cpuRenderingContext } from "../../CpuRenderingContext"
import {
    AttributeData,
    FragShaderHandle,
    UniformData,
    VaryingData,
    ShaderLocalData,
    VertShaderHandle,
    StructData,
} from "../../ShaderDefine"
import {
    IntData,
    FloatData,
    Vec2Data,
    Vec3Data,
    Vec4Data,
    Mat2Data,
    Mat3Data,
    Mat4Data,
    BoolData,
    Sampler2D,
    SamplerCube,
} from "../builtin/BuiltinData"
let CC_DEVICE_SUPPORT_FLOAT_TEXTURE = new FloatData(0)
let CC_ENABLE_CLUSTERED_LIGHT_CULLING = new FloatData(0)
let CC_DEVICE_MAX_VERTEX_UNIFORM_VECTORS = new FloatData(4096)
let CC_DEVICE_MAX_FRAGMENT_UNIFORM_VECTORS = new FloatData(1024)
let CC_DEVICE_CAN_BENEFIT_FROM_INPUT_ATTACHMENT = new FloatData(0)
let CC_PLATFORM_ANDROID_AND_WEBGL = new FloatData(0)
let CC_ENABLE_WEBGL_HIGHP_STRUCT_VALUES = new FloatData(0)
let CC_JOINT_UNIFORM_CAPACITY = new FloatData(256)
let CC_EFFECT_USED_VERTEX_UNIFORM_VECTORS = new FloatData(65)
let CC_EFFECT_USED_FRAGMENT_UNIFORM_VECTORS = new FloatData(42)
class AttributeDataImpl implements AttributeData {
    dataKeys: Map<string, any> = new Map([])
    dataSize: Map<string, number> = new Map([])
}
class VaryingDataImpl extends VaryingData {
    v_uv: Vec2Data = new Vec2Data()

    factoryCreate() {
        return new VaryingDataImpl()
    }
    dataKeys: Map<string, any> = new Map([["v_uv", cpuRenderingContext.cachGameGl.FLOAT_VEC2]])
    copy(varying: VaryingDataImpl) {
        glSet_V2_V2(varying.v_uv, this.v_uv)
    }
}
class UniformDataImpl implements UniformData {
    mainTexture: Sampler2D = new Sampler2D()
    dataKeys: Map<string, any> = new Map([["mainTexture", cpuRenderingContext.cachGameGl.SAMPLER_2D]])
    dataSize: Map<string, number> = new Map([["mainTexture", 1]])
}
class ShaderLocalDataImpl implements ShaderLocalData {
    dataKeys: Map<string, any> = new Map([])
    dataSize: Map<string, number> = new Map([])
    init() {}
}
export class Impl_a3b33aa4c211c3d116dbd1feaca12ad6 extends FragShaderHandle {
    varyingData: VaryingDataImpl = new VaryingDataImpl()
    uniformData: UniformDataImpl = new UniformDataImpl()

    CCFragOutput_V4(__color__: Vec4Data): Vec4Data {
        let color: Vec4Data = vec4()
        glSet_V4_V4(color, __color__)

        return color
    }
    frag(): Vec4Data {
        return this.CCFragOutput_V4(texture2D_N_V2(this.uniformData.mainTexture, this.varyingData.v_uv))
    }
    main(): void {
        glSet_V4_V4(gl_FragColor, this.frag())
    }
}
